package com.sky.mapper;

import com.sky.entity.SetmealDish;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查询数据
     * @param dishIds
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /**
     * 根据套餐id查询
     * @param setmealId
     * @return
     */
    @Select("select  * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getListBySetmealId(Long setmealId);

    /**
     * 新增
     * @param setmealDish
     */

    void insert(SetmealDish setmealDish);

    /**
     * 根据套餐id批量删除
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);


    /**
     * 批量新增
     * @param setmealDishes
     */
    void insertSetmeal(List<SetmealDish> setmealDishes);
}
